<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="${ctx }">
<title>手机登陆</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<meta name="format-detection" content="telephone=no" />
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
 <meta charset="UTF-8">
    <!-- IE兼容模式 -->
    <meta http-equiv="X-UA-COMPATIBLE" content="IE=edge">
    <meta name="viewport"
          content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
    <!-- 采用高速模式渲染（目前仅有360支持） -->
    <meta name="renderer" content="webkit">
    <!-- Bootstrap 核心 CSS库 -->
    <link href="${ctx }/styles/BJUI/new/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font-awesome 图标 CSS库 -->
    <link href="css/font-awesome.min.css" rel="stylesheet">
    <!-- JQuery UI CSS库 -->
    <link href="${ctx }/styles/BJUI/new/css/jquery-ui.min.css" rel="stylesheet">
    <!-- JQuery -->
    <script src="${ctx }/styles/BJUI/new/js/jquery-1.10.2.min.js"></script>
    <script src="${ctx }/styles/BJUI/new/js/jquery.unobtrusive-ajax.min.js"></script>
    <!-- JQuery UI -->
    <script src="${ctx }/styles/BJUI/new/js/jquery-ui.min.js"></script>
    <!-- 脉动提示插件 -->
    <script src="${ctx }/styles/BJUI/new/js/jquery.pulsate.min.js"></script>
    <!-- Bootstrap 核心 JS库 -->
    <script src="${ctx }/styles/BJUI/new/js/bootstrap.min.js"></script>
    <!-- 浏览器判断 -->
    <script src="${ctx }/styles/BJUI/new/js/Browser.js"></script>
    <!--时间控件样式-->
    <!--时间控件mobiscroll-->
    <!-- 母版页 样式 -->
    <link href="${ctx }/styles/BJUI/new/css/carousel.css" rel="stylesheet">
    <link href="${ctx }/styles/BJUI/new/css/style.css" rel="stylesheet">
    <link href="${ctx }/styles/BJUI/new/css/leon.css" rel="stylesheet">
    <link href="${ctx }/styles/BJUI/new/css/index.css" rel="stylesheet">
    <link href="${ctx }/styles/BJUI/new/css/nprogress.css" rel="stylesheet">
<script src="${ctx }/styles/BJUI/new/js/nprogress.js"></script>
    <link href="${ctx }/styles/BJUI/new/css/Browsertiper.css" rel="stylesheet"/>
</head>

<body>

<div class="clearfix">
    <div class="carousel-inner" id="mainWindow" style="position: relative;background-color: white">
    <form action="" id="form1">
<input type="hidden" name="url" value="${url}" /> <input id="BizId"
			type="hidden" name="BizId" />
        <div class="row" style="margin-top: 5px;padding: 20px">
            <div class="col-sm-8 box-40-mb-1 text-center">
                <label class="label-text" style="font-size: 20px">首次登录请绑定手机</label>
            </div>
            <div class="col-sm-8 box-40-mb-1 text-center">
               <div style="width: auto;height: 1px;background-color: gainsboro;margin-bottom: 10px"></div>
            </div>
            <div class="col-sm-8 box-40-mb-1">
                <a class="a-orange" target="_blank" data-toggle="modal" data-target="#StudentModal" tabindex="-1"
                  onclick="javascript:sendCode()">
                    <div class="display-right text-center label-and-input" style="width:100px;">
                        <span style="line-height: 40px;color: #ffffff">发送验证码</span>
                    </div>
                </a>
                <input name="mobilePhone" id="mobilePhone" class="input-max display-left placeholder-right placeholder-left" style="border: 1px solid gainsboro" placeholder="手机号码">
            </div>
            <div class="col-sm-8 box-40-mb-1" style="margin-top: 10px">
                <input name="code"  id="codes" class="input-max display-left placeholder-left" style="border: 1px solid gainsboro" placeholder="验证码">
            </div>
	   <div class="col-sm-8 box-40-mb-1" style="margin-top: 10px">
      <input name="agreement" style="vertical-align: middle;"
				type="checkbox" /> <a  href='http://mp.weixin.qq.com/s?__biz=MzIzODM5MjU0Nw==&mid=100000068&idx=1&sn=f652acd06d256d1536a427fce5fd4de5&scene=23&srcid=0722VefsyNLH6aJKYXpM0BkU#rd'
				style="margin-left: 10px">接受用户使用条款</a>
            </div>
            <div class="col-sm-8 box-40-mb-1" style="margin-top: 10px">
                <a class="a-blue" target="_blank" data-toggle="modal" data-target="#StudentModal" tabindex="-1"
                   onclick="javascript:ajaxTest()">
                    <div id="confirmButton" class="display-right text-center"
                         style="width:100%">
                        <span style="line-height: 50px;color: #ffffff">确定</span>
                        
                    </div>
                </a>
            </div>
              
        </div>
        
            </form>
    </div>

</div>
	
</body>
<script src="${ctx }/styles/BJUI/new/js/ddes.js" charset="UTF-8"></script>
<script type="text/javascript">
	function sendCode() {
		if (isSending) {
			alert("正在发送短信，请勿频繁操作");
			return;
		}
		alert("正在发送短信，请勿频繁操作");
		$.ajax({
			data : {
				"phoneNum" : $("input[id='mobilePhone']").val()
			},
			type : "POST",
			dataType : 'json',
			url : "${ctx }/weixinView/sendVerifys",
			error : function(data) {
				isSending = false;
				alert("出错了！！:");
			},
			beforeSend : function(data) {
				isSending = true;
			},
			success : function(data) {
				if (data['status'] == 0) {
					isSending = false;
					alert(data['msg']);
						BizId = data['data'];
					$("input[id='BizId']").val(BizId);
				} else {
					alert(data['msg']);
				}
			}
		});
	}

	var isSending = false;
	var BizId;
	function ajaxTest() {
		if(BizId==""||BizId==null)
			{
			alert("请先获取验证码");
		return;
			}
		if($("input[id='codes']").val().trim()=="验证码"||$("input[id='codes']").val().trim()==""){
		alert("请先获取验证码");
		return;
		}
		if(isNaN($("input[id='codes']").val()))
		{
		alert("请先获取验证码");
		return;
		}
		$.ajax({
			data : $('form').serialize(),
			type : "POST",
			dataType : 'json',
			url : "${ctx }/weixinView/weixinlogin",
			error : function(data) {
				alert("出错了！！:");
			},
			success : function(data) {
				if (data['status'] == 0) {
					alert("注册成功");
					window.location.href = data['msg'];
				} else {
					alert(data['msg']);
				}
			}
		});

	}
</script>
</html>
